﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FrienDev.BusinessRules;

public partial class Controls_SystemMessage_Friend_FriendPassed : System.Web.UI.UserControl,ISystemMessageControl
{
    public string MessageId { get; set; }
    public string SendDateTime { get; set; }
    
    private string m_SenderId;
    public string SenderId
    {
        get
        {
            return m_SenderId;
        }
        set
        {
            m_SenderId = value;
        }
    }

    private string m_SenderName;
    public string SenderName
    {
        get
        {
            return m_SenderName;
        }
        set
        {
            m_SenderName = value;
        }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        this.hy_SendName.Text = SenderName;
        this.hy_SendName.NavigateUrl = ApiHelper.Instance.GetUserHomepageLink(SenderId);
        this.hy_SendName2.Text = SenderName;
        this.hy_SendName2.NavigateUrl = ApiHelper.Instance.GetUserHomepageLink(SenderId);
        this.cimg_RMPhoto.Attributes["src"] = ApiHelper.Instance.GetUserLogoUrl(SenderId);
    }

    #region ISystemMessageControl Members

    public void Initialize(int messageId,string[] parameters)
    {
        /* *参数列表
           第一个是应用程序英文名，第二个是消息类别名称；
         * 第三个是发送者ID，第四个是发送者姓名，
         * 第五个是附加消息
         */
        SenderId = parameters[2];
        SenderName = parameters[3];
        //SendDateTime = parameters[2];
        MessageId = MessageId = messageId.ToString(); ;
    }

    #endregion
}
